<?php

namespace App\Http\Requests\Api;

class FilialeRequest extends FormRequest
{
    public function rules()
    {
        switch($this->method())
        {
            case 'POST':
                return [
                    'name' => 'required|string',
                    'phone' => 'required|string',
                    'address' => 'required|string',
                ];
                break;

            case 'PATCH':
                return [
                    'name' => 'string',
                    'phone' => 'string',
                    'address' => 'string',
                ];
                break;
        }
    }

    public function attributes()
    {
        return [
            'name' => '商家分店名称',
            'phone' => '商家分店电话',
            'address' => '商家分店地址',
        ];
    }
}
